package com.wnhz.wnmap.stats.controller;

import com.wnhz.wnmap.common.result.HttpResp;
import com.wnhz.wnmap.stats.vo.Richer;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

@RestController
@RequestMapping("/api/stats")
public class RicherController {
    @GetMapping("/rich")
    @CrossOrigin
    public HttpResp rich(){
        List<Richer> list = new ArrayList<>();
        Random random = new Random();
        list.add(new Richer(random.nextInt(500)+100,"曲世军"));
        list.add(new Richer(random.nextInt(500)+100,"杨家明"));
        list.add(new Richer(random.nextInt(500)+100,"吴志华"));
        list.add(new Richer(random.nextInt(500)+100,"征程"));
        list.add(new Richer(random.nextInt(500)+100,"黄嘉欣"));
        return HttpResp.success(list);
    }
}
